home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Online / TASC / rexx / Gooddomain.thor < prev    next >
Text File  |  1997-09-27  |  2KB  |  70 lines

  1. /* $VER: Gooddomain.thor V0.1 (25/07/97)
  2. *  Takes a successful complaint & adds the senders domain to a file.
  3. *  This file can be used by TASC.thor to remind you that it's worth
  4. *  complaining here.
  5. */
  6.  
  7. /*============Don't change anything below here==================*/
  8.  
  9. options results
  10. options failat 31
  11.  
  12. /* Read the config file & set up defalts if it isn't there */
  13. if open(cfg,'Env:thor/TASC.cfg',r) then do
  14.    do until eof(cfg)
  15.        lin=readln(cfg)
  16.        parse var lin id ':' V
  17.        V=strip(V)
  18.        if upper(left(id,8))='DATABASE' then
  19.           spamdb=V
  20.     end
  21.     call close(cfg)
  22. end
  23. else do
  24.     spamdb='spam.db'
  25. end
  26.  
  27. thorport = address()
  28. if left(thorport, 5) ~= 'THOR.' then do
  29.   say 'Cannot find thorport.'
  30.   exit
  31. end
  32.  
  33. if ~show('p', 'BBSREAD') then do
  34.   address command
  35.   "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
  36.   "WaitForPort BBSREAD"
  37. end
  38.  
  39. if open(A,'env:thor/BBSdatapath') then do
  40.     BBSP=READLN(A)
  41.     call close(A)
  42. end
  43.  
  44. address(thorport)
  45.  
  46. CURRENTMSG stem MSG
  47. if (rc ~= 0) then call oops("No current message.")
  48. address BBSREAD
  49. READBRMESSAGE bbsname '"'MSG.BBSNAME'"' confname '"'MSG.CONFNAME'"' msgnr MSG.MSGNR headstem HEADTAGS textstem TEXTTAGS
  50. if (rc ~= 0) then call oops
  51. Parse VAR HEADTAGS.FROMADDR gubbins '@' domain
  52. say HEADTAGS.FROMADDR
  53. /*say domain||'->8-} >> '||BBSP||'db/'||spamdb*/
  54.  
  55. address command
  56. 'echo '||domain||'->8-} >> '||BBSP||'db/'||spamdb
  57.  
  58. oops:
  59.   PARSE ARG errmsg
  60.   if errmsg = '' then do
  61.     if address() = "BBSREAD" then errmsg=BBSREAD.LASTERROR
  62.     else errmsg=THOR.LASTERROR
  63.   end
  64.   address(thorport)
  65.   REQUESTNOTIFY TEXT '"' errmsg '"' BT '"_Abort"'
  66. return
  67.  
  68. exit
  69.  
  70.